package cn.j229.bug.zhongxuan.hualian.service;

import cn.j229.bug.zhongxuan.hualian.pojo.Ticket;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

/**
 * @Author smile_ZhongXuan
 * @Date 2020/10/20 14:26
 * @Version 1.0
 */
public interface TicketService {
    /**
     * 新增优惠券方法
     * @param ticket
     * @return 1
     */
    int addTicketSelective(Ticket ticket);

    /**
     * 查询全部的优惠券，并进行分页
     * @return
     */
    Map findAllTicketByPage(Integer page,Integer size);

    /**
     * 导出优惠券列表为excel表格方法
     * @param hssfWorkbook
     * @return .xls
     * @throws UnsupportedEncodingException
     */
    String exportTicketList(HSSFWorkbook hssfWorkbook) throws UnsupportedEncodingException;

    /**
     * 根据id号更新优惠券状态，0下架，1上架
     * @param ticket
     * @return
     */
    int updateTicketState(Ticket ticket);
}
